#include "run.h"

void d2im_run(){

    als_evt     *evt  = &glb_d2im.cur_evt;
    als_evtq    *evtq =  glb_d2im.evtq;
    int         count = 0;

    glb_d2im.state = GS_START;

    al_start_timer( glb_d2im.timer );
    while( glb_d2im.state != GS_END ){
        al_wait_for_event( evtq, evt );
        count ++;
        //debug_print("event occur: %d\n", count);
        if( evt->type == ALE_KEY_DOWN && evt->keyboard.keycode == ALK_ESC ){
            glb_d2im.state = GS_END;
            continue;
        }
		al_flip_display();
    }
}
